import Loadable from 'react-loadable'
import Loading from "../components/Loading"

/* import Login from "../views/Login"
import DashBoard from "../views/DashBoard"
import ArtList from "../views/Article"
import ArtEdit from "../views/Article/ArtEdit"
import ArtAdd from '../views/Article/ArtAdd'
import Settings from "../views/Settings"
import NotFound from "../views/NotFound"
 */
import {
  BarChartOutlined,
  OrderedListOutlined,
  SettingOutlined
} from "@ant-design/icons"

const baseRoutes = [
  {
    path:"/login",
    component:Loadable({
      loader: () => import('../views/Login'),
      loading: Loading,
    })
  },
  {
    path:"/404",
    component:Loadable({
      loader: () => import('../views/NotFound'),
      loading: Loading,
    })
  }
]

const AdminRoutes = [
  {
    path:"/dashBoard",
    title:"仪表盘",
    isNav:true,
    icon:BarChartOutlined,
	roles:['001','002'],
    component:Loadable({
      loader: () => import('../views/DashBoard'),
      loading: Loading,
    })
  },
  {
    path:"/artList",
    title:"文章列表",
    isNav:true,
    icon:OrderedListOutlined,
	roles:['001','002'],
    component:Loadable({
      loader: () => import('../views/Article'),
      loading: Loading,
    })
  },
  {
    path:"/artEdit/:id",
    title:"文章编辑",
    isNav:false,
	roles:['001','002'],
    component:Loadable({
      loader: () => import('../views/Article/ArtEdit'),
      loading: Loading,
    })
  },
  {
    path:"/artAdd",
    title:"添加文章",
    isNav:false,
	roles:['001','002'],
    component:Loadable({
      loader: () => import('../views/Article/ArtAdd'),
      loading: Loading,
    })
  },
  {
    path:"/settings",
    title:"设置",
    icon:SettingOutlined,
    isNav:true,
	roles:['002'],
    component:Loadable({
      loader: () => import('../views/Settings'),
      loading: Loading,
    })
  }
]

export {
  baseRoutes,
  AdminRoutes
}